﻿#pragma once

#include "client/GameNetClient.h"
#include "common/basictypes.h"
#include <string>

namespace KBEngineClient
{

class KBEGameSocket 
{
private:
    KBEGameSocket();
    KBEGameSocket(const KBEGameSocket &);
    KBEGameSocket &operator=(const KBEGameSocket &);
    ~KBEGameSocket();

public:
    static KBEGameSocket &getInstance()
    {
        static KBEGameSocket instance;
        return instance;
    }

    bool connectionServer(const char *ipStr, uint32 port = 8001);

    void sendData(char *data, int size);
    //releasesockte
    void releaseSocket();
    //创建socket
    void createSocket();

private:
    GameNetClient *gameSocket;
    std::string ip;
    uint32 port;
};

}
